<?php

# First, try the 'language' parameter
# If there was no language specified or specified language did not exist
# then we try languages specified by the browser
$supported_lang = explode(',',$_SERVER["HTTP_ACCEPT_LANGUAGE"]);
if(isset($_GET['language'])) {
	array_unshift($supported_lang, $_GET['language']);
}
foreach($supported_lang as $l) {
	if(substr($l, 0, 5) == 'pt-br') {
		$l = 'br';
	}
	$l = substr($l, 0, 2);
	if(file_exists('lang/'.$l.'.php')) {
		$language = $l;
		break;
	}
}
if(!isset($language)) {
	$language = 'ru';
}
require('lang/ru.php');
require('lang/'.$language.'.php');

require("config.php");
require("include/functions.php");
require("pics/drap/liste.php");

$manual_mirror = !!$_GET['manual_mirror'];

if ($manual_mirror)
	load_lists();

define("EASYURPMI", 1);

if ($_GET['autorepo'])
	require("include/urpmi-media.php");

header('Content-Type: text/html; charset=UTF-8');

?>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN">
<html>

<head>
<title>Easy Urpmi</title>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8">

<link rel=stylesheet type="text/css" href="style.css" title=styleCSS>
</head>

<body lang="<?php echo $language; ?>">

<div align="right" style='position:absolute;top:5px;left:-1px;width:800px;'>
<form name="redir_langue" method="get" action="">
<?php
	echo '<select name="language" style="width:70px;padding:0px;padding-left:20px;text-decoration:none;background-image:url(\'pics/drap/'.$drap[$language].'\');background-position:left center;background-repeat:no-repeat;" onchange="document.redir_langue.submit();">';

	$dir = opendir("lang");
	while (($file = readdir($dir)) != false) {
		if(!ereg("php$", $file))
			continue;
		$reste = basename($file, ".php");
		echo '<option value="'.$reste.'" style="width:70px;padding:0px;padding-left:20px;text-decoration:none;background-image:url(\'pics/drap/'.$drap[$reste].'\');background-position:left center;background-repeat:no-repeat;';
		echo ($reste==$language)?'background-color:green;color:white" selected>':'" >';
		echo "$reste</option>";
	}
	echo '</select></form>';
?>
</div>

</div>

<!--div class=banner>
<div class=news>
<div class=titlenews><?php echo $strNews; ?></div>
<ul style="padding:10px;padding-top:0px;">
<?php
	$motdf=file("news.txt");
	foreach ($motdf as $line) 
		echo "<li type=square>$line</li>";
?>
</ul>
</div>
</div-->

<iframe src="http://www.linuxcenter.ru/trans/adv100x100.phtml?ref=71324" frameborder="0" vspace="0" hspace="0" width="100" height="100" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<iframe src="http://www.linuxcenter.ru/trans/adv100x100.phtml?ref=71324" frameborder="0" vspace="0" hspace="0" width="100" height="100" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<iframe src="http://www.linuxcenter.ru/trans/adv100x100.phtml?ref=71324" frameborder="0" vspace="0" hspace="0" width="100" height="100" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<iframe src="http://www.linuxcenter.ru/trans/adv100x100.phtml?ref=71324" frameborder="0" vspace="0" hspace="0" width="100" height="100" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<iframe src="http://www.linuxcenter.ru/trans/adv100x100.phtml?ref=71324" frameborder="0" vspace="0" hspace="0" width="100" height="100" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<iframe src="http://www.linuxcenter.ru/trans/adv100x100.phtml?ref=71324" frameborder="0" vspace="0" hspace="0" width="100" height="100" marginwidth="0" marginheight="0" scrolling="no"></iframe>
<iframe src="http://www.linuxcenter.ru/trans/adv100x100.phtml?ref=71324" frameborder="0" vspace="0" hspace="0" width="100" height="100" marginwidth="0" marginheight="0" scrolling="no"></iframe>

<div class=content>
<?php
require("include/content.php");
?>
<hr align="left" width="25%">
<div style="font-size:smaller;">
<p>
<?php echo $strThanks; ?> Nanar, Sebastien Ducoulombier (sebd), Pascal Terjan (pterjan), Yves Mettier, Nicolas Mouret (toxss), Sébastien Savarin (Plouf_), trem, Anssi Hannula<br>
<?php echo $strLicense; ?> Основано на коде <a hef="http://easyurpmi.zarb.org">easyurpmi.zarb.org</a></p>
По всем вопросам обращаться на info@edumandriva.ru
<hr align="left" width="25%">
</div>
<table><TR><TD valign="top">
<p>
  <a href="http://validator.w3.org/check?uri=referer"><img border="0"
  src="http://www.w3.org/Icons/valid-html401"
  alt="Valid HTML 4.01!" height="31" width="88"></a>
</p>
</TD><TD valign="top">
<p>
 <a href="http://jigsaw.w3.org/css-validator/">
  <img style="border:0;width:88px;height:31px"
   src="http://jigsaw.w3.org/css-validator/images/vcss" 
   alt="Valid CSS!">
 </a>
</TD><TD valign="top">
<p>
<a href="http://www.73lab.com" target=new><img border="1" 
	 src="pics/73lab.png" 
	 alt="Design by ayo" title="Design by Ayo" height="29" width="88"></a>
</p></TD>
</TR></table>

</div>
</body>
</html>
